Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

table/tables: fix load partition when upgrade from an old TiDB (#17971) #17983

Merged
merged 2 commits into from
Jun 15, 2020

Conversation

sre-bot
Copy link
Contributor

@sre-bot sre-bot commented Jun 12, 2020

cherry-pick #17971 to release-4.0


What problem does this PR solve?

Issue Number: close #17952

Problem Summary:

In the old version TiDB, partition definition store the less than XXX as raw expression.
It should be integer, the new version TiDB assert XXX is an integer.

What is changed and how it works?

What's Changed:

Add some code to handle compatibility.

How it Works:

If the less than expression is not an integer, try to parser it as expression and calculate the integer.

Related changes

  • Need to cherry-pick to the release branch

Check List

Tests

  • Manual test (add detailed scripts or steps below)

I have manually test the binary with issue #17952 and it works.

Side effects

Ugly code

Release note

  • Fix a compatibility bug that partition table created in old version TiDB can not be loaded in 4.0, this bug makes the server fail to start.

Signed-off-by: sre-bot <sre-bot@pingcap.com>
@sre-bot
Copy link
Contributor Author

sre-bot commented Jun 12, 2020

/run-all-tests

Copy link
Member

@wjhuang2016 wjhuang2016 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link

@imtbkcat imtbkcat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tiancaiamao
Copy link
Contributor

/run-all-tests

1 similar comment
@tiancaiamao
Copy link
Contributor

/run-all-tests

@tiancaiamao tiancaiamao merged commit e93590e into pingcap:release-4.0 Jun 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants